package utility

import (
	"io/ioutil"
	"os"
)

func PathExists(path string) bool {
	_, err := os.Stat(path)
	if err == nil {
		return true
	}
	if os.IsNotExist(err) {
		return false
	}
	return false
}

func ReadFileAsBytes(path string) ([]byte, error) {
	fi, err := os.Open(path)
	defer fi.Close()
	if err != nil {
		return nil, err
	}
	fd, err := ioutil.ReadAll(fi)
	return fd, err
}
